package com.niit.onlinemusic.controller;

import com.niit.onlinemusic.common.R;
import com.niit.onlinemusic.model.request.AdminRequest;
import com.niit.onlinemusic.service.AdminService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * 管理员控制器
 *
 * @author zuwei522
 * @since 2025/9/16 15:31
 */
@RequestMapping("admin/login")
@RestController
public class AdminController {

    private final AdminService adminService;

    public AdminController(AdminService adminService) {
        this.adminService = adminService;
    }

    @PostMapping("status")
    public R login(@RequestBody AdminRequest adminRequest, HttpSession session) {
        return adminService.verifyPassword(adminRequest, session);
    }

}
